<script setup>
import { useCommonStore } from "@/store/index";

const commonStore = useCommonStore();
commonStore.setData();
commonStore.startInterval();

const gotoURL = () => {
  let url = commonStore.data[20]?.content;
  window.open(url);
};
</script>

<template>
  <div class="header"></div>
  <div class="box">
    <div class="item">
      <img class="img" src="/src/assets/img/top1.png" />
      <div>
        <div class="title">
          <active-number :value="commonStore.data[0]?.content"></active-number>
        </div>
        <div class="content">茶园面积(万亩)</div>
      </div>
    </div>
    <div class="item">
      <img class="img" src="/src/assets/img/top2.png" />
      <div>
        <div class="title">
          <active-number :value="commonStore.data[1]?.content"></active-number>
        </div>
        <div class="content">茶叶产量 (万吨)</div>
      </div>
    </div>
    <div class="item">
      <img class="img" src="/src/assets/img/top3.png" />
      <div>
        <div class="title">
          <active-number :value="commonStore.data[2]?.content"></active-number>
        </div>
        <div class="content">总价值(元)</div>
      </div>
    </div>
    <div class="item">
      <img class="img" src="/src/assets/img/top4.png" />
      <div>
        <div class="title">
          <active-number :value="commonStore.data[3]?.content"></active-number>
        </div>
        <div class="content">农户(户)</div>
      </div>
    </div>
    <div class="item">
      <img class="img" src="/src/assets/img/top5.png" />
      <div>
        <div class="title">
          <active-number :value="commonStore.data[4]?.content"></active-number>
        </div>
        <div class="content">合作社(家)</div>
      </div>
    </div>
    <div class="item">
      <img class="img" src="/src/assets/img/top6.png" />
      <div>
        <div class="title">
          <active-number :value="commonStore.data[5]?.content"></active-number>
        </div>
        <div class="content">企业(家)</div>
      </div>
    </div>
  </div>
  <!-- <div class="bottom" @click="gotoURL" v-if="commonStore.data[20]?.content">浙江茶产业大脑</div> -->
</template>

<style lang="scss" scoped>
@import "@/assets/font/font.css";
.bottom {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: all;
  font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
  font-weight: 400;
  font-size: 14px;
  color: #ffffff;
  line-height: 52px;
  letter-spacing: 2px;
  text-shadow: 0px 2px 8px rgba(17, 20, 22, 0.31),
    0px 0px 46px rgba(46, 174, 255, 0.63);
}

.header {
  width: 100%;
  background: url("/src/assets/img/title.png") no-repeat;
  height: 100px;
}

.box {
  margin: 0 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

  .item {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    color: #fff;
    width: 211px;

    img {
      margin-right: 20px;
    }

    .title {
      font-size: 24px;
      font-weight: bold;
      margin-bottom: 10px;
      background-image: -webkit-linear-gradient(bottom, #9dc0de, #3a85be);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }
}
</style>
